<template>
  <div>
    <van-nav-bar title="房屋管理" left-arrow @click-left="$router.go(-1)" />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
    <HouseList v-for="item in list" :key="item.id" :item = item></HouseList>
    </van-list>
  </div>
</template>

<script>
import { Userhouse } from '@/api/other'
import HouseList from '@/components/HouseItem.vue'
export default {
  components: {
    HouseList
  },
  data () {
    return {
      finished: false,
      loading: false,
      list: []
    }
  },
  methods: {
    async onLoad () {
      const res = await Userhouse()
      // console.log(res)
      this.list = res.body
      this.$nextTick(() => {
        this.finished = true
      })
    }
  }
}
</script>

<style>
</style>
